package teacher.service.laohe;

import java.util.List;
import com.opensymphony.xwork2.ActionContext;
import teacher.bean.Award;
import teacher.bean.Teacher;

public class AwardShow {
	
	private int flag;
	private List<Award> awards;
	

	public int getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	public List<Award> getAwards() {
		return awards;
	}

	public void setAwards(List<Award> awards) {
		this.awards = awards;
	}


	public String execute()
	{	
		Teacher teacher=(Teacher)ActionContext.getContext().getSession().get("teacher");
		Award award =new Award();
		
		if(flag==0)
		{
			award.setLevel(0);
			this.setAwards(new ListShow().getAwardByUser(award, null, teacher));
		}
		else if(flag==1)
		{
			award.setLevel(1);
			this.setAwards(new ListShow().getAwardByUser(award, null, teacher));
		}
		else if(flag==2)
		{
			award.setLevel(2);
			this.setAwards(new ListShow().getAwardByUser(award, null, teacher));
		}
		else
		{
			award.setLevel(3);
			this.setAwards(new ListShow().getAwardByUser(award, null, teacher));
		}
		
		return "succ";
	}
}
